<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>更新选课</title>
    <!-- 可选的样式表链接 -->
    <link rel="stylesheet" type="text/css" href="/css/styles.css" />
</head>
<body>
<h2>更新选课</h2>
<form th:action="@{/score/updateScore}" th:object="${score}" method="post">
    <!-- 课程号，由模型传递并预填充 -->
    <div>
        <label for="tno">学号</label>
        <input type="text" id="tno" th:field="*{sno}" th:readonly="true" required />
        <!-- 假设 Score 类的属性名为 id，且为不可修改 -->
        <span th:if="${#fields.hasErrors('sno')}" th:errors="*{sno}"></span>
    </div>
    <div>
        <label for="cno">课程号</label>
        <input type="text" id="cno" th:field="*{cno}" th:readonly="true" required />
        <!-- 假设 Score 类的属性名为 id，且为不可修改 -->
        <span th:if="${#fields.hasErrors('cno')}" th:errors="*{cno}"></span>
    </div>
    <!-- 课程名称 -->
    <div>
        <label for="score">分数</label>
        <input type="number" id="score" th:field="*{score}" required />
        <span th:if="${#fields.hasErrors('score')}" th:errors="*{score}"></span>
    </div>


    <!-- 提交按钮 -->
    <div>
        <button type="submit">提交</button>
    </div>
</form>
</body>
</html>